import { RECORD_ADDRESS } from './../actionTypes'

export default {
    state: {
        latitude: '',
        longitude: ''
    },
    getters: {
        latitude: (state) => state.latitude,
        longitude: (state) => state.longitude
    },
    mutations: {
        // 记录当前经度纬度
        [RECORD_ADDRESS](state, { latitude, longitude }) {
            state.latitude = latitude;
            state.longitude = longitude;
        }
    },
    actions: {
        [RECORD_ADDRESS]({ commit, state }, xy) {
            commit('RECORD_ADDRESS', xy)
        }
    }
}